<template>
  <div class='nav-box'>
    <el-menu
      :default-active="activeIndex"
      class="el-menu-demo"
      mode="horizontal"
      @select="handleSelect"
      background-color="#fff"
      active-text-color="red"
      text-color="#000"
      :router="true"
    >
      <el-menu-item index="/home/tuijian">个性推荐</el-menu-item>
      <el-menu-item index="/home/gedan">歌单</el-menu-item>
      <el-menu-item index="3">排行榜</el-menu-item>
      <el-menu-item index="4">歌手</el-menu-item>
    </el-menu>
      <!-- 子路由渲染位置 -->
  <router-view></router-view>
  </div>
<div>

</div>


</template>
<script setup>
import { ref } from 'vue'
//默认激活
const activeIndex = ref('/home/tuijian')
//item激活事件
const handleSelect = (key, keyPath) => {
  console.log(key, keyPath)
}


</script>
<style lang="less" scoped>
.nav-box{
  width: 100%;
  .el-menu{
    border-bottom: 0;
  }
}
</style>